<%-- 
    Document   : index
    Created on : Apr 6, 2011, 9:41:50 AM
    Author     : Noi Nho
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="dto.Tour"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Tour Management</title>
    </head>
    <body>
        <a href="administrator.jsp?page=tour&action=add">Add a new tour</a>
         <table>
            <tr>
                <td width="50">Tour ID</td>
                <td width="50">Tour category ID</td>
                <td width="100">Tour name</td>
                <td width="50">Price</td>
                <td width="250">Description</td>
                <td>Action</td>
            </tr>
            <%
                        ArrayList<Tour> tours = (ArrayList<Tour>) request.getAttribute("tours");
                        if (tours != null) {
                            for (Tour item : tours) {
            %>
            <tr>
                <td><% out.println(item.getTourID());%></td>
                <td><% out.println(item.getTourCate().getTourCateID());%></td>
                <td><% out.println(item.getName());%></td>
                <td><% out.println(item.getPrice());%></td>
                <td><% out.println(item.getDescription());%></td>
                <td><a href="administrator.jsp?page=tuor&action=edit&tourID=<% out.println(item.getTourID());%>">Update</a>, <a href="administrator.jsp?page=tuor&action=delete&tourID=<% out.println(item.getTourID());%>">Delete</a></td>
            </tr>
            <%                                }
                        }
            %>
        </table>
    </body>
</html>
